package com.member.shop.domain;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.member.common.annotation.Excel;
import com.member.common.config.RmConfig;
import com.member.common.constant.SystemConst;
import com.member.common.core.domain.BaseEntity;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.SuperBuilder;
import org.apache.commons.lang3.StringUtils;

/**
 * 抽奖结果对象 sys_biz_raffle_results
 *
 * @author thomas
 * @date 2024-03-21
 */
@Data
@SuperBuilder
@AllArgsConstructor
@NoArgsConstructor
@TableName("sys_biz_raffle_results")
public class SysBizRaffleResults extends BaseEntity {

    private static final long serialVersionUID = 1L;

    /**
     * 抽奖结果id
     */
    @TableId(type = IdType.AUTO)
    private Long resultId;

    /**
     * 用户id
     */
    @Excel(name = "用户id")
    private Long userId;

    /**
     * 奖品表id
     */
    @Excel(name = "奖品表id")
    private Long prizeId;

    /**
     * 活动表id
     */
    @Excel(name = "活动表id")
    private Long activityId;

    /**
     * 用户名称(冗余)
     */
    @Excel(name = "用户名称(冗余)")
    private String userName;

    /**
     * 奖品名称(冗余)
     */
    @Excel(name = "奖品名称(冗余)")
    private String prizeName;

    /**
     * 是否奖品(0:奖品，1:非奖品)(冗余)
     */
    @Excel(name = "是否奖品(0:奖品，1:非奖品)(冗余)")
    private Long isPrize;

    /**
     * 奖品类型（1：积分，2：优惠券，3.实物，4：谢谢惠顾）(冗余)
     */
    @Excel(name = "奖品类型", readConverterExp = "1=：积分，2：优惠券，3.实物，4：谢谢惠顾")
    private Integer prizeType;

    /**
     * 提取状态（0 待领取 1 已领取 2 待发货 3 已完成）
     */
    @Excel(name = "奖品类型", readConverterExp = "0 待领取 1 已领取 2 待发货 3 已完成")
    private Integer extractStatus;


    /**
     * 提取方式（0 线上 1 门店自提）
     */
    @Excel(name = "提取方式", readConverterExp = "（0 线上 1 门店自提）")
    private Integer extractMethod;


    /**
     * 核销状态 （0 待核销 1 已核销 2 不核销）
     */
    @Excel(name = "核销状态", readConverterExp = "（0 待核销 1 已核销 2 不核销）")
    private Integer writeOffStatus;

    /**
     * 核销代码
     */
    @Excel(name = "核销代码" )
    private String writeOffCode;
    /**
     * 提取门店
     */
    @Excel(name = "提取门店")
    private Long extractShopId;
    /**
     * 奖品图片(冗余)
     */
    @Excel(name = "奖品图片(冗余)")
    private String prizeImage;
    @TableField(exist = false)
    private String prizeImageAbsolute;

    public String getPrizeImage() {
        return prizeImage;
    }

    public void setPrizeImage(String prizeImage) {
        this.prizeImage = prizeImage;


        prizeImageAbsolute = prizeImage;
        String domain = RmConfig.getDomain();
        if (StringUtils.isNotEmpty(prizeImage) && !prizeImage.startsWith(SystemConst.HTTP)) {
            prizeImageAbsolute = domain + prizeImage;
        }
    }

    public String getPrizeImageAbsolute() {
        return prizeImageAbsolute;
    }

    public void setPrizeImageAbsolute(String prizeImageAbsolute) {
        this.prizeImageAbsolute = prizeImageAbsolute;
    }


    /**
     * 奖品说明(冗余)
     */
    @Excel(name = "奖品说明(冗余)")
    private String prizeDetails;

    /**
     * 数量(冗余)
     */
    @Excel(name = "数量(冗余)")
    private Long prizeAmount;

    /**
     * 活动标题(冗余)
     */
    @Excel(name = "活动标题(冗余)")
    private String title;

    /**
     * 活动附标题(冗余)
     */
    @Excel(name = "活动附标题(冗余)")
    private String subtitle;

    /**
     * 联系方式
     */
    @Excel(name = "联系方式")
    private String phone;

    /**
     * 省
     */
    @Excel(name = "省")
    private String province;

    /**
     * 市
     */
    @Excel(name = "市")
    private String city;

    /**
     * 区
     */
    @Excel(name = "区")
    private String area;

    /**
     * 收件人姓名
     */
    @Excel(name = "收件人姓名")
    private String name;

    /**
     * 详细地址
     */
    @Excel(name = "详细地址")
    private String details;

    /**
     * 是否删除(0：未删除，1：删除)
     */
    @Excel(name = "是否删除(0：未删除，1：删除)")
    private Integer deleted;

}
